/************************************************************
 *This file is part of Searcj_PRJ.
 *
 * This program is free.
 *
 * @file    Configuration.h
 * @brief   get config file
 *
 * @author  Dgg
 * @email   1390713385@qq.com
 * @version 0.0.1.0
 * @date    2024/10/13
 * @license GUN General Public License(GPL)
 *
 * ------------------------------------------------
 * Remark   :Description
 * ------------------------------------------------
 * Change History:
 *    <Date>   |    <Version>    |   <Author>   |   <Description>
 * 2024/10/13  |     0.0.1.0     |      Dgg     |     createfile
 *
 */
#ifndef __CONFIGURATION_H__
#define __CONFIGURATION_H__

#include <string>
#include <set>
#include <map>
#include <memory>

using std::string;
using std::set;
using std::pair;
using std::map;

class Configuration{
public:
    static Configuration *getInstance(const string &filepath);
    void initConfiguration();
    set<string> &find_config(const string &key);

private:
    friend class std::unique_ptr<Configuration>;
    Configuration(const string &filepath);
    ~Configuration();
    Configuration(const Configuration &) = delete;
    Configuration &operator=(const Configuration &) = delete;
    map<string, string> &getConfigMap();
    set<string> getStopWordList();

private:
    static Configuration *_instance;
    string _filepath;
    set<string> _stopWordList;
    map<string, set<string>> _configMap;
};

#endif